namespace Greg.XmlEditor.Business.Concrete
{
	public class ValidationService : IValidationService
	{
		public IOperationResult Validate(string xmlString)
		{
			var validationResult = new OperationResult();
			var validator = new XmlValidator();

			validationResult.Succeeded = validator.Validate(xmlString);
			validationResult.Message = validator.ValidationResult;

			return validationResult;
		}

		public IOperationResult Validate(string xmlString, string xmlSchemaPath)
		{
			var validationResult = new OperationResult();
			var validator = new XmlValidator();

			validationResult.Succeeded = validator.Validate(xmlString, xmlSchemaPath);
			validationResult.Message = validator.ValidationResult;

			return validationResult;
		}
	}
}